Other Functions

The following functions are available globally.

  • Creates a new MGLMapPoint from the given X and Y coordinates, and zoom level.

    Declaration

    Objective-C

    static inline MGLMapPoint MGLMapPointMake(CGFloat x, CGFloat y,
                                              CGFloat zoomLevel)

    Swift

    func MGLMapPointMake(_ x: CGFloat, _ y: CGFloat, _ zoomLevel: CGFloat) -> MGLMapPoint
  • Returns Mercator projection of a WGS84 coordinate at the specified zoom level.

    Declaration

    Objective-C

    extern MGLMapPoint MGLMapPointForCoordinate(CLLocationCoordinate2D coordinate,
                                                double zoomLevel)

    Swift

    func MGLMapPointForCoordinate(_ coordinate: CLLocationCoordinate2D, _ zoomLevel: Double) -> MGLMapPoint
  • Creates a new MGLTransition from the given duration and delay.

    Declaration

    Objective-C

    static inline MGLTransition MGLTransitionMake(NSTimeInterval duration,
                                                  NSTimeInterval delay)

    Swift

    func MGLTransitionMake(_ duration: TimeInterval, _ delay: TimeInterval) -> MGLTransition

    Parameters

    duration

    The amount of time the animation should take, not including the delay.

    delay

    The amount of time in seconds to wait before beginning the animation.

    Return Value

    Returns a MGLTransition struct containing the transition attributes.